-- GENERATED SPELL FOR [Lava Spawn] --


function spell0_12265(pUnit, Event) --@Fireball,n/a--
pUnit:FullCastSpellOnTarget(19391,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_12265', 2000, 1)
end

function spell1_12265(pUnit, Event) --@Split,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(19569,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_12265', 1, 1)
end

function spell2_12265(pUnit, Event) --@Split,Self--
pUnit:FullCastSpellOnTarget(19570,pUnit)
pUnit:RegisterEvent('Sorts_12265', 517, 1)
end

function Sorts_12265(pUnit, Event)
local choix_sorts_12265 = math.random(0, 2)
if choix_sorts_12265 == 0 then
pUnit:RegisterEvent('spell0_12265', 1, 1)
end
if choix_sorts_12265 == 1 then
pUnit:RegisterEvent('spell1_12265', 1, 1)
end
if choix_sorts_12265 == 2 then
pUnit:RegisterEvent('spell2_12265', 1, 1)
end
end

function mob12265_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_12265', math.random(1500, 3000), 1)
end

function mob12265_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob12265_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob12265_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(12265, 1, 'mob12265_Action')
RegisterUnitEvent(12265, 2, 'mob12265_Leave')
RegisterUnitEvent(12265, 3, 'mob12265_Kill')
RegisterUnitEvent(12265, 4, 'mob12265_Die')
